package com.szsfm.vehiclemanagement.tcp;

import android.app.Service;
import android.os.AsyncTask;

public class TcpTask extends AsyncTask<Void, Void, Void> {
	private final Service svc;
	private final TcpCore sav;

	
	public TcpTask(Service svc, TcpCore sav) {
		super();
		this.svc = svc;
		this.sav = sav;
	}	

	@Override
	protected Void doInBackground(Void... params) {
		sav.loop();
		return null;
	}

	@Override
	protected void onPostExecute(Void result) {
		svc.stopSelf();
	}

}
